<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
  <button>发送请求</button>
</body>
<script>
    const btn = document.querySelector("button");
	function fn(obj){
		console.log(obj);
    }
	btn.onclick = function(){
		// 1- 生成一个script元素
        const script = document.createElement("script");
		// 2- 为script增加src属性
		script.src = "http://127.0.0.1/jsonp";
		// 3- 将script元素放置到body中
		document.body.appendChild(script);
    }
</script>
</html>